package com.pbking.util.logging
{
	import flash.events.Event;

	/**
	 * The event that gets dispatched from PBLoggers.
	 * 
	 * @param message String The message associated with the log
	 * @param level int The level of the log
	 * @param category String the category of the PBLogger that
	 * dispatched the log
	 */
	public class PBLogEvent extends Event
	{
		public static const LOG:String = "log";
		
		public var message:String;
		public var level:int;
		public var category:String;
		
		function PBLogEvent(message:String, level:int, category:String, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			this.message = message;
			this.level = level;
			this.category = category;
			
			super(LOG, bubbles, cancelable);
		}
		
		override public function toString():String
		{
			return category + " | " + PBLogLevel.getLevelLabel(level) + " | " + message;
		}
	}
}